| Conditions | 2 |
| Total Lines | 21 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 29 | |||
| 30 | @Put(':id') |
||
| 31 | @Roles(UserRole.PHOTOGRAPHER) |
||
| 32 | @ApiOperation({ summary: 'Update event' }) |
||
| 33 | public async index(@Param() { id }: IdDTO, @Body() dto: EventDTO) { |
||
| 34 | try { |
||
| 35 | const { date, schoolId, userId, summary } = dto; |
||
| 36 | |||
| 37 | await this.commandBus.execute( |
||
| 38 | new UpdateEventCommand( |
||
| 39 | id, |
||
| 40 | new Date(date), |
||
| 41 | userId, |
||
| 42 | schoolId, |
||
| 43 | summary |
||
| 44 | ) |
||
| 45 | ); |
||
| 46 | |||
| 47 | return { id }; |
||
| 48 | } catch (e) { |
||
| 49 | throw new BadRequestException(e.message); |
||
| 50 | } |
||
| 53 |